﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NTmdb.TestProject
{
    /// <summary>
    ///     This is a test class for TmdbMovieTest and is intended
    ///     to contain all TmdbMovieTest Unit Tests
    /// </summary>
    [TestClass]
    public class TmdbMovieTest
    {
        /// <summary>
        ///     A test for TmdbMovie Constructor
        /// </summary>
        [TestMethod]
        public void TmdbMovieConstructorTest()
        {
            var target = new TmdbMovie();
            Assert.IsNotNull( target );
        }

        /// <summary>
        ///     A test for GetReleaseDate
        /// </summary>
        [TestMethod]
        public void GetReleaseDateTest()
        {
            var target = new TmdbMovie();
            target.ReleaseDate = "2010-10-20";
            string datePattern = "yyyy-MM-dd";
            var expected = new DateTime( 2010, 10, 20 );
            var actual = ( DateTime ) target.GetReleaseDate( datePattern );
            Assert.AreEqual( expected.ToString( datePattern ), actual.ToString( datePattern ) );
        }

        /// <summary>
        ///     A test for AlternativeTitles
        /// </summary>
        [TestMethod]
        public void AlternativeTitlesTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbAlternativeTitles();
            TmdbAlternativeTitles actual;
            target.AlternativeTitles = expected;
            actual = target.AlternativeTitles;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for BelongsToCollection
        /// </summary>
        [TestMethod]
        public void BelongsToCollectionTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbMovieCollectionPreview();
            TmdbMovieCollectionPreview actual;
            target.BelongsToCollection = expected;
            actual = target.BelongsToCollection;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Budget
        /// </summary>
        [TestMethod]
        public void BudgetTest()
        {
            var target = new TmdbMovie();
            long expected = new Random().Next( 0, Int32.MaxValue );
            long actual;
            target.Budget = expected;
            actual = target.Budget;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Changes
        /// </summary>
        [TestMethod]
        public void ChangesTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbChanges();
            TmdbChanges actual;
            target.Changes = expected;
            actual = target.Changes;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Genres
        /// </summary>
        [TestMethod]
        public void GenresTest()
        {
            var target = new TmdbMovie();
            var expected = new List<TmdbGenre>();
            List<TmdbGenre> actual;
            target.Genres = expected;
            actual = target.Genres;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Homepage
        /// </summary>
        [TestMethod]
        public void HomepageTest()
        {
            var target = new TmdbMovie();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.Homepage = expected;
            actual = target.Homepage;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Images
        /// </summary>
        [TestMethod]
        public void ImagesTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbImages();
            TmdbImages actual;
            target.Images = expected;
            actual = target.Images;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for ImdbId
        /// </summary>
        [TestMethod]
        public void ImdbIdTest()
        {
            var target = new TmdbMovie();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.ImdbId = expected;
            actual = target.ImdbId;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for IsAdult
        /// </summary>
        [TestMethod]
        public void IsAdultTest()
        {
            var target = new TmdbMovie();
            bool expected = new Random().Next( 0, Int32.MaxValue ) % 2 == 0;
            bool actual;
            target.IsAdult = expected;
            actual = target.IsAdult;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Keywords
        /// </summary>
        [TestMethod]
        public void KeywordsTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbMovieKeywords();
            TmdbMovieKeywords actual;
            target.Keywords = expected;
            actual = target.Keywords;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Lists
        /// </summary>
        [TestMethod]
        public void ListsTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbMovieLists();
            TmdbMovieLists actual;
            target.Lists = expected;
            actual = target.Lists;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for MovieReviews
        /// </summary>
        [TestMethod]
        public void MovieReviewsTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbMovieReviews();
            TmdbMovieReviews actual;
            target.MovieReviews = expected;
            actual = target.MovieReviews;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Overview
        /// </summary>
        [TestMethod]
        public void OverviewTest()
        {
            var target = new TmdbMovie();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.Overview = expected;
            actual = target.Overview;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Popularity
        /// </summary>
        [TestMethod]
        public void PopularityTest()
        {
            var target = new TmdbMovie();
            double expected = new Random().Next( 0, Int32.MaxValue );
            double actual;
            target.Popularity = expected;
            actual = target.Popularity;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for ProductionCompanies
        /// </summary>
        [TestMethod]
        public void ProductionCompaniesTest()
        {
            var target = new TmdbMovie();
            var expected = new List<TmdbCompanyBasic>();
            List<TmdbCompanyBasic> actual;
            target.ProductionCompanies = expected;
            actual = target.ProductionCompanies;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for ProductionCountries
        /// </summary>
        [TestMethod]
        public void ProductionCountriesTest()
        {
            var target = new TmdbMovie();
            var expected = new List<TmdbProductionCountry>();
            List<TmdbProductionCountry> actual;
            target.ProductionCountries = expected;
            actual = target.ProductionCountries;
            Assert.AreSame( expected, actual );
        }


        /// <summary>
        ///     A test for Releases
        /// </summary>
        [TestMethod]
        public void ReleasesTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbReleases();
            TmdbReleases actual;
            target.Releases = expected;
            actual = target.Releases;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Revenue
        /// </summary>
        [TestMethod]
        public void RevenueTest()
        {
            var target = new TmdbMovie();
            long expected = new Random().Next( 0, Int32.MaxValue );
            long actual;
            target.Revenue = expected;
            actual = target.Revenue;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Runtime
        /// </summary>
        [TestMethod]
        public void RuntimeTest()
        {
            var target = new TmdbMovie();
            var expected = new Random().Next( 0, Int32.MaxValue );
            int? actual;
            target.Runtime = expected;
            actual = target.Runtime;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for SimilarMovies
        /// </summary>
        [TestMethod]
        public void SimilarMoviesTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbAdvancedMoviePreviewList();
            TmdbAdvancedMoviePreviewList actual;
            target.SimilarMovies = expected;
            actual = target.SimilarMovies;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for SpokenLanguages
        /// </summary>
        [TestMethod]
        public void SpokenLanguagesTest()
        {
            var target = new TmdbMovie();
            var expected = new List<TmdbSpokenLanguage>();
            List<TmdbSpokenLanguage> actual;
            target.SpokenLanguages = expected;
            actual = target.SpokenLanguages;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Staff
        /// </summary>
        [TestMethod]
        public void StaffTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbStaff();
            TmdbStaff actual;
            target.Staff = expected;
            actual = target.Staff;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Status
        /// </summary>
        [TestMethod]
        public void StatusTest()
        {
            var target = new TmdbMovie();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.Status = expected;
            actual = target.Status;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Tagline
        /// </summary>
        [TestMethod]
        public void TaglineTest()
        {
            var target = new TmdbMovie();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.Tagline = expected;
            actual = target.Tagline;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Trailers
        /// </summary>
        [TestMethod]
        public void TrailersTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbTrailers();
            TmdbTrailers actual;
            target.Trailers = expected;
            actual = target.Trailers;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Translations
        /// </summary>
        [TestMethod]
        public void TranslationsTest()
        {
            var target = new TmdbMovie();
            var expected = new TmdbTranslations();
            TmdbTranslations actual;
            target.Translations = expected;
            actual = target.Translations;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for Serialize & Deserialize
        /// </summary>
        [TestMethod]
        [DeploymentItem( @"..\..\TestData\movie_all.json.txt" )]
        public async Task SerializeDeserializeTest()
        {
            var target = new TmdbMovie();
            var jsonContent = File.ReadAllText( "movie_all.json.txt" );
            var actual = await target.DeserializeJson<TmdbMovie>( jsonContent );

            Assert.AreEqual( true, actual.IsAdult );
            Assert.AreEqual( "/bCJLxmgNaZtpMyWKCCiTYrf3YOT.jpg", actual.BackdropPath );
            Assert.IsNull( actual.BelongsToCollection );
            Assert.AreEqual( 180000000, actual.Budget );

            //Check genres
            Assert.AreEqual( 3, actual.Genres.Count );
            Assert.AreEqual( 28, actual.Genres[ 0 ].Id );
            Assert.AreEqual( "Action", actual.Genres[ 0 ].Name );

            Assert.AreEqual( 12, actual.Genres[ 1 ].Id );
            Assert.AreEqual( "Adventure", actual.Genres[ 1 ].Name );

            Assert.AreEqual( 878, actual.Genres[ 2 ].Id );
            Assert.AreEqual( "Science Fiction", actual.Genres[ 2 ].Name );

            Assert.AreEqual( "http://www.pacificrimmovie.com/", actual.Homepage );
            Assert.AreEqual( 68726, actual.Id );
            Assert.AreEqual( "tt1663662", actual.ImdbId );
            Assert.AreEqual( "Pacific Rim", actual.OriginalTitle );
            Assert.AreEqual(
                "When legions of monstrous creatures, known as Kaiju, started rising from the sea, a war began that would take millions of lives and consume humanity's resources for years on end. To combat the giant Kaiju, a special type of weapon was devised: massive robots, called Jaegers, which are controlled simultaneously by two pilots whose minds are locked in a neural bridge. But even the Jaegers are proving nearly defenseless in the face of the relentless Kaiju. On the verge of defeat, the forces defending mankind have no choice but to turn to two unlikely heroes�a washed-up former pilot (Charlie Hunnam) and an untested trainee (Rinko Kikuchi)�who are teamed to drive a legendary but seemingly obsolete Jaeger from the past. Together, they stand as mankind's last hope against the mounting apocalypse.",
                actual.Overview );
            Assert.AreEqual( 47.6963716591165, actual.Popularity );
            Assert.AreEqual( "/sCJEwEShZvruTpQ2a4yiX3Q9EyZ.jpg", actual.PosterPath );

            //Check companies
            Assert.AreEqual( 3, actual.ProductionCompanies.Count );
            Assert.AreEqual( 923, actual.ProductionCompanies[ 0 ].Id );
            Assert.AreEqual( "Legendary Pictures", actual.ProductionCompanies[ 0 ].Name );

            Assert.AreEqual( 4209, actual.ProductionCompanies[ 1 ].Id );
            Assert.AreEqual( "Warner Bros Pictures", actual.ProductionCompanies[ 1 ].Name );

            Assert.AreEqual( 8805, actual.ProductionCompanies[ 2 ].Id );
            Assert.AreEqual( "Industrial Light & Magic (ILM)", actual.ProductionCompanies[ 2 ].Name );

            //Check countries
            Assert.AreEqual( 2, actual.ProductionCountries.Count );
            Assert.AreEqual( "US", actual.ProductionCountries[ 0 ].Iso3166_1 );
            Assert.AreEqual( "United States of America", actual.ProductionCountries[ 0 ].Name );

            Assert.AreEqual( "CA", actual.ProductionCountries[ 1 ].Iso3166_1 );
            Assert.AreEqual( "Canada", actual.ProductionCountries[ 1 ].Name );

            Assert.AreEqual( "2013-07-12", actual.ReleaseDate );
            Assert.AreEqual( 0, actual.Revenue );
            Assert.AreEqual( 131, actual.Runtime );

            //Check languages
            Assert.AreEqual( 1, actual.SpokenLanguages.Count );
            Assert.AreEqual( "English", actual.SpokenLanguages[ 0 ].Name );
            Assert.AreEqual( "en", actual.SpokenLanguages[ 0 ].Iso639_1 );

            Assert.AreEqual( "Released", actual.Status );
            Assert.AreEqual( "To Fight Monsters, We Created Monsters", actual.Tagline );
            Assert.AreEqual( "Pacific Rim", actual.Title );
            Assert.AreEqual( 6.5, actual.VoteAverage );
            Assert.AreEqual( 113, actual.VoteCount );

            //Check alternative titles
            Assert.AreEqual( 2, actual.AlternativeTitles.Titles.Count );
            Assert.AreEqual( 0, actual.AlternativeTitles.Id );

            Assert.AreEqual( "CN", actual.AlternativeTitles.Titles[ 0 ].Iso3166_1 );
            Assert.AreEqual( "????", actual.AlternativeTitles.Titles[ 0 ].Title );

            Assert.AreEqual( "TW", actual.AlternativeTitles.Titles[ 1 ].Iso3166_1 );
            Assert.AreEqual( "????", actual.AlternativeTitles.Titles[ 1 ].Title );

            Assert.IsTrue( false, "missing cast_id property on cast object." );
            //Check cast
            Assert.AreEqual( 3, actual.Staff.Cast.Count );
            Assert.AreEqual( 17605, actual.Staff.Cast[ 0 ].Id );
            Assert.AreEqual( "Idris Elba", actual.Staff.Cast[ 0 ].Name );
            Assert.AreEqual( "Stacker Pentecost", actual.Staff.Cast[ 0 ].Character );
            Assert.AreEqual( 0, actual.Staff.Cast[ 0 ].Order );
            Assert.AreEqual( "/irZD1Z8g9fTZ4d3rZ7BTVJ2rupE.jpg", actual.Staff.Cast[ 0 ].ProfilePath );

            Assert.AreEqual( 56365, actual.Staff.Cast[ 1 ].Id );
            Assert.AreEqual( "Charlie Hunnam", actual.Staff.Cast[ 1 ].Name );
            Assert.AreEqual( "Raleigh Becket", actual.Staff.Cast[ 1 ].Character );
            Assert.AreEqual( 1, actual.Staff.Cast[ 1 ].Order );
            Assert.AreEqual( "/bZD3r5pzCMrqGrQksCdxfkmQ7ur.jpg", actual.Staff.Cast[ 1 ].ProfilePath );

            Assert.AreEqual( 142193, actual.Staff.Cast[ 2 ].Id );
            Assert.AreEqual( "Diego Klattenhoff", actual.Staff.Cast[ 2 ].Name );
            Assert.AreEqual( "Yancy Becket", actual.Staff.Cast[ 2 ].Character );
            Assert.AreEqual( 12, actual.Staff.Cast[ 2 ].Order );
            Assert.AreEqual( "/lxL8yYmjK6KQzpuuUqeb3S4Ax5v.jpg", actual.Staff.Cast[ 2 ].ProfilePath );

            //check crew
            Assert.AreEqual( 2, actual.Staff.Crew.Count );

            Assert.AreEqual( 10828, actual.Staff.Crew[ 0 ].Id );
            Assert.AreEqual( "Guillermo del Toro", actual.Staff.Crew[ 0 ].Name );
            Assert.AreEqual( "Directing", actual.Staff.Crew[ 0 ].Department );
            Assert.AreEqual( "/aBPPwt3jcFw2ridEkKTgchfPaic.jpg", actual.Staff.Crew[ 0 ].ProfilePath );

            Assert.AreEqual( 114016, actual.Staff.Crew[ 1 ].Id );
            Assert.AreEqual( "Travis Beacham", actual.Staff.Crew[ 1 ].Name );
            Assert.AreEqual( "Writing", actual.Staff.Crew[ 1 ].Department );
            Assert.AreEqual( null, actual.Staff.Crew[ 1 ].ProfilePath );

            //Check backdrops
            Assert.AreEqual( 2, actual.Images.Backdrops.Count );
            Assert.AreEqual( "/bCJLxmgNaZtpMyWKCCiTYrf3YOT.jpg", actual.Images.Backdrops[ 0 ].FilePath );
            Assert.AreEqual( 1920, actual.Images.Backdrops[ 0 ].Width );
            Assert.AreEqual( 1080, actual.Images.Backdrops[ 0 ].Height );
            Assert.AreEqual( "xx", actual.Images.Backdrops[ 0 ].Iso639_1 );
            Assert.AreEqual( 1.78, actual.Images.Backdrops[ 0 ].AspectRatio );
            Assert.AreEqual( 5.3968253968254, actual.Images.Backdrops[ 0 ].VoteAverage );
            Assert.AreEqual( 3, actual.Images.Backdrops[ 0 ].VoteCount );

            Assert.AreEqual( "/fFrUEivISpDAWaow29ZIs9gS8lN.jpg", actual.Images.Backdrops[ 1 ].FilePath );
            Assert.AreEqual( 1920, actual.Images.Backdrops[ 1 ].Width );
            Assert.AreEqual( 1080, actual.Images.Backdrops[ 1 ].Height );
            Assert.AreEqual( null, actual.Images.Backdrops[ 1 ].Iso639_1 );
            Assert.AreEqual( 1.78, actual.Images.Backdrops[ 1 ].AspectRatio );
            Assert.AreEqual( 0, actual.Images.Backdrops[ 1 ].VoteAverage );
            Assert.AreEqual( 0, actual.Images.Backdrops[ 1 ].VoteCount );

            //Check posters
            Assert.AreEqual( 3, actual.Images.Posters.Count );
            Assert.AreEqual( "/sCJEwEShZvruTpQ2a4yiX3Q9EyZ.jpg", actual.Images.Posters[ 0 ].FilePath );
            Assert.AreEqual( 1000, actual.Images.Posters[ 0 ].Width );
            Assert.AreEqual( 1500, actual.Images.Posters[ 0 ].Height );
            Assert.AreEqual( "en", actual.Images.Posters[ 0 ].Iso639_1 );
            Assert.AreEqual( 0.67, actual.Images.Posters[ 0 ].AspectRatio );
            Assert.AreEqual( 5.50671550671551, actual.Images.Posters[ 0 ].VoteAverage );
            Assert.AreEqual( 15, actual.Images.Posters[ 0 ].VoteCount );

            Assert.AreEqual( "/nSv1kxoXQVNZcgOLGs82C01vw5.jpg", actual.Images.Posters[ 1 ].FilePath );
            Assert.AreEqual( 1000, actual.Images.Posters[ 1 ].Width );
            Assert.AreEqual( 1500, actual.Images.Posters[ 1 ].Height );
            Assert.AreEqual( "en", actual.Images.Posters[ 1 ].Iso639_1 );
            Assert.AreEqual( 0.67, actual.Images.Posters[ 1 ].AspectRatio );
            Assert.AreEqual( 5.4421768707483, actual.Images.Posters[ 1 ].VoteAverage );
            Assert.AreEqual( 7, actual.Images.Posters[ 1 ].VoteCount );

            Assert.AreEqual( "/lN6o91zCLcBXjNniBhTKnJILW4o.jpg", actual.Images.Posters[ 2 ].FilePath );
            Assert.AreEqual( 3435, actual.Images.Posters[ 2 ].Width );
            Assert.AreEqual( 5000, actual.Images.Posters[ 2 ].Height );
            Assert.AreEqual( null, actual.Images.Posters[ 2 ].Iso639_1 );
            Assert.AreEqual( 0.69, actual.Images.Posters[ 2 ].AspectRatio );
            Assert.AreEqual( 0.0, actual.Images.Posters[ 2 ].VoteAverage );
            Assert.AreEqual( 0, actual.Images.Posters[ 2 ].VoteCount );

            //Check keywords
            Assert.AreEqual( 3, actual.Keywords.Keywords.Count );
            Assert.AreEqual( 159062, actual.Keywords.Keywords[ 0 ].Id );
            Assert.AreEqual( "monster movie", actual.Keywords.Keywords[ 0 ].Name );

            Assert.AreEqual( 10891, actual.Keywords.Keywords[ 1 ].Id );
            Assert.AreEqual( "giant robot", actual.Keywords.Keywords[ 1 ].Name );

            Assert.AreEqual( 179431, actual.Keywords.Keywords[ 2 ].Id );
            Assert.AreEqual( "duringcreditsstinger", actual.Keywords.Keywords[ 2 ].Name );

            //Check releases
            Assert.AreEqual( 2, actual.Releases.Releases.Count );
            Assert.AreEqual( "US", actual.Releases.Releases[ 0 ].Iso3166_1 );
            Assert.AreEqual( "PG-13", actual.Releases.Releases[ 0 ].Certification );
            Assert.AreEqual( "2013-07-12", actual.Releases.Releases[ 0 ].ReleaseDate );

            Assert.AreEqual( "DE", actual.Releases.Releases[ 1 ].Iso3166_1 );
            Assert.AreEqual( "", actual.Releases.Releases[ 1 ].Certification );
            Assert.AreEqual( "2013-07-18", actual.Releases.Releases[ 1 ].ReleaseDate );

            //Check trailers
            Assert.AreEqual( 0, actual.Trailers.Quicktime.Count );
            Assert.AreEqual( 1, actual.Trailers.Youtube.Count );
            Assert.AreEqual( "Trailer", actual.Trailers.Youtube[ 0 ].Name );
            Assert.AreEqual( "HD", actual.Trailers.Youtube[ 0 ].Size );
            Assert.AreEqual( "zA92Rw6kNWw", actual.Trailers.Youtube[ 0 ].Source );

            //Check translations
            Assert.AreEqual( 3, actual.Translations.Translations.Count );
            Assert.AreEqual( "en", actual.Translations.Translations[ 0 ].Iso639_1 );
            Assert.AreEqual( "English", actual.Translations.Translations[ 0 ].Name );
            Assert.AreEqual( "English", actual.Translations.Translations[ 0 ].EnglishName );

            Assert.AreEqual( "pt", actual.Translations.Translations[ 1 ].Iso639_1 );
            Assert.AreEqual( "Portugu�s", actual.Translations.Translations[ 1 ].Name ); //sorry had no time to mess around with the text encoding...
            Assert.AreEqual( "Portuguese", actual.Translations.Translations[ 1 ].EnglishName );

            Assert.AreEqual( "tr", actual.Translations.Translations[ 2 ].Iso639_1 );
            Assert.AreEqual( "T�rk�e", actual.Translations.Translations[ 2 ].Name );
            Assert.AreEqual( "Turkish", actual.Translations.Translations[ 2 ].EnglishName );

            //Check similar movies
            Assert.AreEqual( 1, actual.SimilarMovies.PageNumber );
            Assert.AreEqual( 16211, actual.SimilarMovies.TotalResults );
            Assert.AreEqual( 811, actual.SimilarMovies.TotalPages );
            Assert.AreEqual( 2, actual.SimilarMovies.Movies.Count );

            Assert.AreEqual( false, actual.SimilarMovies.Movies[ 0 ].IsAdult );
            Assert.AreEqual( "/fbxIbXIxHfVp6qFrNfMU0drEF08.jpg", actual.SimilarMovies.Movies[ 0 ].BackdropPath );
            Assert.AreEqual( 12636, actual.SimilarMovies.Movies[ 0 ].Id );
            Assert.AreEqual( "Gojira tai Mekagojira", actual.SimilarMovies.Movies[ 0 ].OriginalTitle );
            Assert.AreEqual( "2002-11-02", actual.SimilarMovies.Movies[ 0 ].ReleaseDate );
            Assert.AreEqual( "/gOqKXzKpHiMa7tMCGSNQvRtKeGe.jpg", actual.SimilarMovies.Movies[ 0 ].PosterPath );
            Assert.AreEqual( 1.08392434364917, actual.SimilarMovies.Movies[ 0 ].Popularity );
            Assert.AreEqual( "Godzilla Against MechaGodzilla", actual.SimilarMovies.Movies[ 0 ].Title );
            Assert.AreEqual( 6.0, actual.SimilarMovies.Movies[ 0 ].VoteAverage );
            Assert.AreEqual( 1, actual.SimilarMovies.Movies[ 0 ].VoteCount );

            Assert.AreEqual( false, actual.SimilarMovies.Movies[ 1 ].IsAdult );
            Assert.AreEqual( "/ArPKC2tTGDa4kzUIT8s2tiRsqpS.jpg", actual.SimilarMovies.Movies[ 1 ].BackdropPath );
            Assert.AreEqual( 6593, actual.SimilarMovies.Movies[ 1 ].Id );
            Assert.AreEqual( "Gojira tai Mechagojira", actual.SimilarMovies.Movies[ 1 ].OriginalTitle );
            Assert.AreEqual( "1993-12-11", actual.SimilarMovies.Movies[ 1 ].ReleaseDate );
            Assert.AreEqual( "/x42ySGBAEycpCLcwVUbzC87ry3G.jpg", actual.SimilarMovies.Movies[ 1 ].PosterPath );
            Assert.AreEqual( 0.455811262014355, actual.SimilarMovies.Movies[ 1 ].Popularity );
            Assert.AreEqual( "Godzilla vs. Mechagodzilla II", actual.SimilarMovies.Movies[ 1 ].Title );
            Assert.AreEqual( 8.0, actual.SimilarMovies.Movies[ 1 ].VoteAverage );
            Assert.AreEqual( 1, actual.SimilarMovies.Movies[ 1 ].VoteCount );

            //Check reviews
            Assert.AreEqual( 1, actual.MovieReviews.PageNumber );
            Assert.AreEqual( 1, actual.MovieReviews.TotalResults );
            Assert.AreEqual( 1, actual.MovieReviews.TotalPages );
            Assert.AreEqual( 1, actual.MovieReviews.Reviews.Count );

            Assert.IsTrue( false, "has to many properties!" );
            Assert.AreEqual( "51e86ad719c29529911b8687", actual.MovieReviews.Reviews[ 0 ].Id );
            Assert.AreEqual( "GeekMasher", actual.MovieReviews.Reviews[ 0 ].Author );
            Assert.AreEqual(
                "First I want to say I liked this movie. I was surprised, \r\n I've been hearing bad reviews but I can't see big problem. The only issues was with the story. Apart from that the graphics where very good. The actors where okay (no major actors) and the baddies (no spoilers) where well thought out and graphically impressive (same for the robots).\r\n\r\nAll in all a good movie.",
                actual.MovieReviews.Reviews[ 0 ].Content );
            Assert.AreEqual( "http://j.mp/15qxoRI", actual.MovieReviews.Reviews[ 0 ].Url );

            //Checking movie lists
            Assert.IsTrue( false, "has to many properties.. (list type)" );
            Assert.AreEqual(1, actual.Lists.PageNumber);
            Assert.AreEqual(11, actual.Lists.TotalResults);
            Assert.AreEqual(1, actual.Lists.TotalPages);
            Assert.AreEqual( 2, actual.Lists.MovieLists.Count );

            Assert.AreEqual("Must watch Sci-Fi films for 2013, in no particular order.", actual.Lists.MovieLists[0].Description);
            Assert.AreEqual(20, actual.Lists.MovieLists[0].FavoriteCount);
            Assert.AreEqual("50cbe90b19c2956de8047b4f", actual.Lists.MovieLists[0].Id);
            Assert.AreEqual(10, actual.Lists.MovieLists[0].ItemCount);
            Assert.AreEqual("en", actual.Lists.MovieLists[0].Iso639_1);
            Assert.AreEqual("Sci-Fi films to see in 2013", actual.Lists.MovieLists[0].Name);
            Assert.AreEqual("/pmyZRPocfjmXaGBddtz8EmlfrRX.jpg", actual.Lists.MovieLists[0].PosterPath);

            Assert.AreEqual("", actual.Lists.MovieLists[1].Description);
            Assert.AreEqual(1, actual.Lists.MovieLists[1].FavoriteCount);
            Assert.AreEqual("51c04514760ee3063c0a5b7f", actual.Lists.MovieLists[1].Id);
            Assert.AreEqual(33, actual.Lists.MovieLists[1].ItemCount);
            Assert.AreEqual("en", actual.Lists.MovieLists[1].Iso639_1);
            Assert.AreEqual("Wantet By Hans", actual.Lists.MovieLists[1].Name);
            Assert.AreEqual("/4DV9RDbePf15jKK80Nvlip4TW8A.jpg", actual.Lists.MovieLists[1].PosterPath);

            //Check changes
            Assert.AreEqual( 2, actual.Changes.Changes.Count );

            Assert.AreEqual( "alternative_titles", actual.Changes.Changes[ 0 ].Key );
            Assert.AreEqual( 1, actual.Changes.Changes[ 0 ].ChangedItems.Count );
            Assert.AreEqual("51ebfb56760ee379210b45cd", actual.Changes.Changes[0].ChangedItems[0].Id);
            Assert.AreEqual("added", actual.Changes.Changes[0].ChangedItems[0].Action);
            Assert.AreEqual("2013-07-21 15:16:38 UTC", actual.Changes.Changes[0].ChangedItems[0].Time);


            Assert.AreEqual("trailers", actual.Changes.Changes[1].Key);
            Assert.AreEqual(1, actual.Changes.Changes[1].ChangedItems.Count);
            Assert.AreEqual("51ebfba9760ee336451c5fdf", actual.Changes.Changes[1].ChangedItems[0].Id);
            Assert.AreEqual("added", actual.Changes.Changes[1].ChangedItems[0].Action);
            Assert.AreEqual("2013-07-21 15:18:01 UTC", actual.Changes.Changes[1].ChangedItems[0].Time);
            Assert.AreEqual("zh", actual.Changes.Changes[1].ChangedItems[0].Iso639_1);
        }
    }
}